package s14.ch16.ex2;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

public class MyTextStreams {

	public static void main(String[] args) throws IOException {

		Reader reader = new FileReader("input.txt");
		Writer writer = new FileWriter("output.txt");

		Integer data = null;

		while ((data = reader.read()) != -1) {
			System.out.println(data);
			System.out.println((char) data.intValue());
			writer.write(data);
		}

		reader.close();
		writer.close();
	}

}
